# 函数 局部变量 nonlocal

def funA():
    age = 18
    def funB():
        nonlocal age
        age = 19

    def funC():
        nonlocal name
        name = '黄飞'

    print(f'执行funB()前 age:{age}')
    funB()
    print(f'执行funB()后 age:{age}')
    funC()
    print(f'执行funC()前本没有name属性,执行funC()后 name:{name}')

funA()